home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
Archives
/
ForCLI
/
Renumber.lha
/
Renumber
/
renumber.doc
< prev
Wrap
Text File
|
1996-03-24
|
4KB
|
105 lines
_ ____ __ ____ _
/ \ / /\ / //\/ // / / \
/__/ /_ / \ / // / //_ /_ /__/ A nice script utility
/\ / / // // // \ / /\
/ \ /___ / / \__// / \__//___ / \ (c) 1996 Jan Krutisch
Version 1 Revision 0
INTRODUCTION
There are times where you just miss a simple utility nobody ever
thought of and although one could easily write an arexx-script,
it seems to be the better solution to write in a serious language
with loads of options, to prepare it for every "could be"
situation. Renumber is such a tool. It took me merely 3 hours of
relaxed coding (only because I'm a bit foolish) and now it's there
The thing as such is quite simple. It takes a given input(text)file
and searches for a pattern in every line. It replaces this "key"
by a running (increasing, decreasing) number. This is quite cool
for various purposes...It is easy to create a script by using the
LFORMAT switch of LIST...And it's easy to insert a static "key"
into every line (talking about using LIST). But try to insert a
running number...thou gets stuffed. Using my `count` program or a
strange combination of various CLI-Commands does not help since
all programs enclosed in `-signs are executed just once. Using
renumber, you would include a special "key" into your LFORMAT and
then running "renumber" on the whole script.
Or thinking about numbering a special LIST output to create
filelists...or numbering sourcecode...well, just do it...
USAGE
The template looks like this: FROM/A,TO/A,START/N/K,S=STEP/N/K,K=KEY/K
FROM -> The input file. (Must be specified !)
TO -> The output file. (Must be specified !)
START -> The first inserted number (Default: 0)
STEP -> The step value for increasing the numbers (Default: 1)
KEY -> The key "Renumber" will replace by it's numbers (Def: %%)
Examples
Imagine a scriptfile "Ram:Test" looking like this:
copy "abc-bass" to pc1:samp%%
copy "abc-synth" to pc1:samp%%
copy "abc-synth2" to pc1:samp%%
Now I run >> Renumber ram:test ram:test2 << on it:
copy "abc-bass" to pc1:samp0
copy "abc-synth" to pc1:samp1
copy "abc-synth2" to pc1:samp2
Or I would run >> Renumber ram:test ram:test2 start 10 step 10 <<
copy "abc-bass" to pc1:samp10
copy "abc-synth" to pc1:samp20
copy "abc-synth2" to pc1:samp30
Or I could do >> Renumber ram:test ram:test2 start 5 key "$$"
Of course this would change nothing, because the specified key
is not to be found in the original script.
This should be enough. I think the usage is quite straightforward.
HISTORY
Well. None. This is V1.0 and it runs. I fixed some serious bugs in
the beta-versions, but who cares...
FUTURE
I want to implement a "Zero-Fill" that makes 1 looks like 01 or 001
if you want it to. I tried to implement it in this version, but E
does not work the way I wanted it to be :( Will be Version 1.1, I
swear.
LEGALS
This is Public Domain. The shareware fee is $450. No, seriously, I
can't see any point why I should protect this thingie in any way.
Destroy it, delete it, or eat it (could be interesting...).
Well...nearly. I do claim a copyright on the original source thats
coming with this archieve. Change a single byte and it's yours.
BUT: If you want to use this piece of software in a commercial or
shareware package, I want to know it and I think a full registered
version would be the perfect price...
CONTACT
For Bugreports, hints, choklate, money, synthesizers, drumsamples or
loveletters write to:
halfbyte@arda.shnet.org (Jan Krutisch)
(sorry, no snail.)
EOF